AUX_SOURCE_DIRECTORY(. SRC)

# head file include directory
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/libsrc)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/common)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/lib3rd/include)

# library file find directory
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
    LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/libsrc)
    add_link_options(-Wl,-rpath=./)
elseif (CMAKE_SYSTEM_NAME MATCHES "Windows")
    LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/libsrc)
endif ()

# generate executable file
ADD_EXECUTABLE(main ${SRC})

# link library file
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
    TARGET_LINK_LIBRARIES(main libtaoism.so)
elseif (CMAKE_SYSTEM_NAME MATCHES "Windows")
    TARGET_LINK_LIBRARIES(main libtaoism.lib)
endif()
